﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace C12_Ex03_Shaked_032675316_Itay_032511057
{
    public abstract class ImageFormaterDecorator : IImageFormater
    {
        public ImageFormaterDecorator()
        {
            m_ImageFormater = null;
        }

        protected ImageFormaterDecorator m_ImageFormater;

        public ImageFormaterDecorator(ImageFormaterDecorator i_ImageFormater)
        {
            m_ImageFormater = i_ImageFormater;
        }

        public virtual Image FormatImage(Image i_Image)
        {
            Image imageToReturn;
            if (m_ImageFormater != null)
            {
                imageToReturn = m_ImageFormater.FormatImage(i_Image);
            }
            else
            {
                imageToReturn = i_Image;
            }

            return imageToReturn;
        }
    }
}
